#ifndef _RESPONDER_H_INCLUDED_
#define _RESPONDER_H_INCLUDED_
#include <memory>
#include <mutex>
#include "Socket.h"
//是否应该考虑线程竞争问题？
class responder
{
public:
    int fd;
    size_t bytes_total = -1;
    size_t bytes_left = -1;
    std::shared_ptr<std::string> buffer;
    char* current;
    std::mutex responder_lock;
    responder(int fd, string* buffer, size_t bytes):
    fd(fd),buffer(buffer),responder_lock()
    {
        bytes_total = bytes;
        bytes_left = bytes;
        current = &(*buffer->begin());
    }
    ~responder() = default;
};


#endif